package com.naiterui.ehp.bp.domain;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 医生随访模板

 * @version 2016年11月8日 下午2:52:01
 */
@Entity
@Table(name = "dr_visit_templet")
public class DrVisitTemplet implements Serializable {

    /**
     * 删除状态:0.正常
     */
    public static final Integer TEMPLET_STATUS_NORMAL = 0;

    /**
     * 删除状态: 1.已删除
     */
    public static final Integer TEMPLET_STATUS_DELETED = 1;

    /**
     * 答案类型: 1.多选
     */
    public static final Integer ANSWER_TYPE_CHECKBOX = 1;

    /**
     * 答案类型: 2.填空
     */
    public static final Integer ANSWER_TYPE_FILL = 2;

    /**
     * 模板类型：系统模板
     */
    public static final Integer TEMPLET_TYPE_SYS = 1;
    /**
     * 是否默认：0.否
     */
    public static final Integer TEMPLET_IS_DEFAULT_NO = 0;
    /**
     * 是否默认：1.是
     */
    public static final Integer TEMPLET_IS_DEFAULT_YES = 1;

    /**
     * @Fields serialVersionUID
     */
    private static final long serialVersionUID = 3950001757903993894L;

    private Long id;                    // 模板id
    private Long doctorId;              // 医生id
    private String templetTitle;        // 模板标题
    private Integer isDefault;          // 是否默认。0.否 1.是
    private Integer status;             // 状态: 0.正常 1.已删除
    private Date createdAt;             // 创建时间
    private Date changedAt;             // 修改时间
    private Integer templetType;       // 模板类型 ：1.系统模板 2.用户模板

    /**
     * 模板内容<br/><br/>
     * question 问题<br/>
     * questionIndex 问题序号<br/>
     * answerType 回答类型 1:多选 2:填空<br/>
     * options 选项<br/>
     * option 选项值<br/>
     * optionIndex 选项序号<br/><br/>
     * 格式如下：
     * <p><blockquote>
     * 
     * <pre>
     * [
     *  {
     *      "question": "药物依存性",
     *      "questionIndex": 0,
     *      "answerType": 1,
     *      "options": [
     *          {
     *              "option": "规律",
     *              "optionIndex": 0
     *          },
     *          {
     *              "option": "间隔",
     *              "optionIndex": 1
     *          },
     *          {
     *              "option": "不服药",
     *              "optionIndex": 2
     *          }
     *      ]
     *  },
     *  {
     *      "question": "其他问题",
     *      "questionIndex": 1,
     *      "answerType": 2
     *  }
     * ]
     * </pre>
     * 
     * </blockquote>
     * <p>
     */
    private String templet;

    public DrVisitTemplet() {
    }

    public DrVisitTemplet(Long doctorId, Integer isDefault, Integer status, String templet) {
        this.doctorId = doctorId;
        this.isDefault = isDefault;
        this.status = status;
        this.templet = templet;
        this.createdAt = new Date();
        this.changedAt = new Date();
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "doctor_id")
    public Long getDoctorId() {
        return this.doctorId;
    }

    public void setDoctorId(Long doctorId) {
        this.doctorId = doctorId;
    }

    @Column(name = "is_default")
    public Integer getIsDefault() {
        return this.isDefault;
    }

    public void setIsDefault(Integer isDefault) {
        this.isDefault = isDefault;
    }

    @Column(name = "status")
    public Integer getStatus() {
        return this.status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Column(name = "created_at")
    public Date getCreatedAt() {
        return this.createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    @Column(name = "changed_at")
    public Date getChangedAt() {
        return this.changedAt;
    }

    public void setChangedAt(Date changedAt) {
        this.changedAt = changedAt;
    }

    @Column(name = "templet")
    public String getTemplet() {
        return this.templet;
    }

    public void setTemplet(String templet) {
        this.templet = templet;
    }

    @Column(name = "templet_title")
    public String getTempletTitle() {
        return this.templetTitle;
    }

    public void setTempletTitle(String templetTitle) {
        this.templetTitle = templetTitle;
    }

    @Column(name = "templet_type")
    public Integer getTempletType() {
        return this.templetType;
    }

    public void setTempletType(Integer templetType) {
        this.templetType = templetType;
    }

}
